% Copyright (C) 2022 All rights reserved.
% Authors:     Seonghyeon Jo <cpsc.seonghyeon@gmail.com>
%
% Date:        Jan, 18, 2022
% 
% -------------------------------------------------
% Sawyer Robot 4-DoF
% get a inertia matrix.
% -------------------------------------------------
% Equation)
%       M(q)
%
% Input)
%       x   : Joint Position
% Output)
%       M  : Inertia Matrix
%
% the following code has been tested on Matlab 2021a
function M = compute_M_4DOF(q)
q1=q(1);
q2=q(2);
q3=q(3);
q4=q(4);
t2 = cos(q2);
t3 = sin(q2);
t4 = t3.*6.123233995736766e-17;
t5 = cos(q3);
t11 = t2.*3.749399456654644e-33;
t6 = t4-t11+3.749399456654644e-33;
t7 = sin(q3);
t8 = t2+t4;
t9 = cos(q4);
t10 = t5.*t8;
t14 = t6.*t7;
t12 = t10-t14;
t13 = sin(q4);
t15 = t5.*t6.*6.123233995736766e-17;
t16 = t7.*t8.*6.123233995736766e-17;
t18 = t2.*6.123233995736766e-17;
t17 = t3+t15+t16-t18-2.295845021658468e-49;
t19 = sin(q1);
t20 = cos(q1);
t21 = t2.*t19.*6.123233995736766e-17;
t24 = t20.*6.123233995736766e-17;
t22 = t19-t24;
t27 = t3.*t22;
t23 = t21-t27;
t25 = t19.*6.123233995736766e-17;
t28 = t3.*t19.*3.749399456654644e-33;
t29 = t2.*t22.*6.123233995736766e-17;
t26 = t20+t25-t28-t29;
t30 = t20+t25;
t31 = t5.*t6;
t32 = t7.*t8;
t33 = t20.*3.749399456654644e-33;
t34 = t3.*t20.*6.123233995736766e-17;
t35 = t3.*t20.*3.749399456654644e-33;
t36 = t2.*t30.*6.123233995736766e-17;
t37 = t19-t24+t35+t36;
t38 = t5.*t37.*6.123233995736766e-17;
t39 = t2.*t20.*6.123233995736766e-17;
t44 = t3.*t30;
t40 = t39-t44;
t41 = t7.*t40.*6.123233995736766e-17;
t42 = t2.*t30;
t43 = -t25+t33+t34+t38+t41+t42;
t45 = t7.*t37;
t47 = t5.*t40;
t46 = t45-t47;
t48 = t19.*3.749399456654644e-33;
t49 = t3.*t19.*6.123233995736766e-17;
t50 = t7.*t23.*6.123233995736766e-17;
t51 = t2.*(t19-t24);
t56 = t5.*t26.*6.123233995736766e-17;
t52 = t24+t48+t49+t50+t51-t56;
t53 = t5.*t23;
t54 = t7.*t26;
t55 = t53+t54;
t57 = t2.*1.100898668462938e-36;
t58 = t12.*t13;
t59 = t9.*t17;
t60 = t58+t59;
t61 = t2.*3.366880115214081e-34;
t62 = t9.*t12.*2.53401226709415e-4;
t63 = t5.*t6.*8.979785040610579e-2;
t64 = t7.*t8.*8.979785040610579e-2;
t161 = t3.*5.498532503507515e-18;
t162 = t12.*t13.*4.876002456295764e-2;
t163 = t9.*t17.*4.876002456295764e-2;
t164 = t13.*t17.*2.53401226709415e-4;
t65 = t61+t62+t63+t64-t161-t162-t163-t164+1.2623778474605e-66;
t66 = t2.*2.398600000000009e-4;
t248 = t3.*1.4613e-2;
t67 = t66-t248+2.282446919238515e-35;
t68 = t3-t18;
t69 = t31+t32;
t70 = t3.*3.3204e-3;
t71 = t5.*t6.*2.53e-2;
t72 = t6.*t7.*4.4101e-6;
t73 = t7.*t8.*2.53e-2;
t173 = t2.*2.033158615944436e-19;
t174 = t5.*t8.*4.4101e-6;
t74 = t70+t71+t72+t73-t173-t174-7.623123809914776e-52;
t75 = t69.*t74;
t76 = t20.*3.64905e-1;
t77 = t3.*t20.*7.395859701019415e-18;
t78 = t2.*t30.*1.20783555e-1;
t79 = t3.*t30.*1.38974745e-2;
t80 = t19.*(-6.42057105e-1)+t76+t77+t78+t79-t2.*t20.*8.509748831328481e-19;
t81 = t2.*9.157296440624334e-22;
t82 = t5.*t6.*4.4101e-6;
t83 = t6.*t7.*2.5506e-2;
t84 = t7.*t8.*4.4101e-6;
t175 = t3.*1.4955e-5;
t176 = t5.*t8.*2.5506e-2;
t85 = t81+t82+t83+t84-t175-t176+3.433436229890238e-54;
t86 = t20.*1.0616375;
t87 = t19.*4.46715e-1;
t88 = t3.*t19.*1.350785419459531e-16;
t89 = t7.*t23.*6.053757698066069e-1;
t90 = t2.*(t19-t24).*2.206;
t91 = t9.*t52.*1.18734317978;
t92 = t13.*t52.*5.114817050334782e-3;
t93 = t13.*t55.*1.18734317978;
t185 = t9.*t55.*5.114817050334782e-3;
t186 = t5.*t26.*6.053757698066069e-1;
t94 = t86+t87+t88+t89+t90+t91+t92+t93-t185-t186;
t95 = t20.*3.359125e-1;
t96 = t19.*1.41345e-1;
t97 = t3.*t19.*2.94714864922868e-17;
t98 = t7.*t23.*2.6117415e-2;
t99 = t2.*(t19-t24).*4.813059e-1;
t189 = t5.*t23.*2.799678e-4;
t190 = t5.*t26.*2.6117415e-2;
t191 = t7.*t26.*2.799678e-4;
t100 = t95+t96+t97+t98+t99-t189-t190-t191;
t101 = t20.*4.46715e-1;
t102 = t3.*t20.*1.350785419459531e-16;
t103 = t9.*t43.*1.18734317978;
t104 = t13.*t43.*5.114817050334782e-3;
t105 = t5.*t37.*6.053757698066069e-1;
t106 = t9.*t46.*5.114817050334782e-3;
t107 = t7.*t40.*6.053757698066069e-1;
t108 = t2.*t30.*2.206;
t201 = t19.*1.0616375;
t202 = t13.*t46.*1.18734317978;
t109 = t101+t102+t103+t104+t105+t106+t107+t108-t201-t202;
t110 = t3.*4.0e-1;
t111 = t12.*t13.*2.152934142846781e-1;
t112 = t9.*t17.*2.152934142846781e-1;
t113 = t13.*t17.*9.274373618014111e-4;
t114 = t5.*t6.*1.097689519141626e-1;
t115 = t7.*t8.*1.097689519141626e-1;
t180 = t9.*t12.*9.274373618014111e-4;
t262 = t2.*2.449293598294706e-17;
t116 = t110+t111+t112+t113+t114+t115-t180-t262-5.342894225732869e-34;
t117 = t20.*1.41345e-1;
t118 = t3.*t20.*2.94714864922868e-17;
t119 = t5.*t37.*2.6117415e-2;
t120 = t7.*t37.*2.799678e-4;
t121 = t7.*t40.*2.6117415e-2;
t122 = t2.*t30.*4.813059e-1;
t209 = t19.*3.359125e-1;
t210 = t5.*t40.*2.799678e-4;
t123 = t117+t118+t119+t120+t121+t122-t209-t210;
t124 = t3.*2.7582e-1;
t125 = t5.*t6.*1.4967e-2;
t126 = t6.*t7.*1.6044e-4;
t127 = t7.*t8.*1.4967e-2;
t187 = t5.*t8.*1.6044e-4;
t243 = t2.*1.688910400704115e-17;
t128 = t124+t125+t126+t127-t187-t243-5.342894225732868e-34;
t129 = t20.*6.42057105e-1;
t130 = t19.*3.64905e-1;
t131 = t3.*t19.*7.395859701019415e-18;
t132 = t2.*(t19-t24).*1.20783555e-1;
t133 = t3.*(t19-t24).*1.38974745e-2;
t134 = t129+t130+t131+t132+t133-t2.*t19.*8.509748831328481e-19;
t135 = t2.*3.084900000000001e-3;
t255 = t3.*2.6811e-2;
t136 = t135-t255+3.468981871291444e-34;
t137 = t2.*2.2398e-2;
t256 = t3.*2.398599999999986e-4;
t138 = t137-t256+1.100898668462937e-36;
t139 = t8.*t138;
t140 = t9.*t12;
t203 = t13.*t17;
t141 = t140-t203;
t142 = t2.*4.271754237092021e-36;
t143 = t9.*t12.*8.169842925973351e-1;
t144 = t5.*t6.*1.139316919009596e-3;
t145 = t7.*t8.*1.139316919009596e-3;
t165 = t3.*6.976304090397628e-20;
t166 = t12.*t13.*2.53401226709415e-4;
t167 = t9.*t17.*2.53401226709415e-4;
t168 = t13.*t17.*8.169842925973351e-1;
t146 = t142+t143+t144+t145-t165-t166-t167-t168+1.6016513015515e-68;
t147 = t141.*t146;
t148 = -t4+t11+t31+t32+1.405799628556214e-65;
t149 = t2.*2.881087492837848e-33;
t150 = t9.*t12.*1.139316919009596e-3;
t151 = t5.*t6.*7.684130555159526e-1;
t152 = t7.*t8.*7.684130555159526e-1;
t169 = t3.*4.705172944303244e-17;
t170 = t12.*t13.*8.979785040610579e-2;
t171 = t9.*t17.*8.979785040610579e-2;
t172 = t13.*t17.*1.139316919009596e-3;
t153 = t149+t150+t151+t152-t169-t170-t171-t172+1.080234788022072e-65;
t154 = t148.*t153;
t155 = -t3+t18+2.295845021658468e-49;
t156 = t3.*3.4179e-3;
t157 = t5.*t6.*3.3204e-3;
t158 = t5.*t8.*1.4955e-5;
t159 = t7.*t8.*3.3204e-3;
t177 = t2.*2.092860147402869e-19;
t178 = t6.*t7.*1.4955e-5;
t160 = t156+t157+t158+t159-t177-t178-7.846968699526477e-52;
t179 = t24+t48+t49+t51;
t181 = t7.*t23.*1.097689519141626e-1;
t182 = t9.*t52.*2.152934142846781e-1;
t183 = t13.*t52.*9.274373618014111e-4;
t184 = t13.*t55.*2.152934142846781e-1;
t188 = t7.*t23.*1.4967e-2;
t192 = t7.*t23;
t193 = -t25+t33+t34+t42;
t194 = t3.*2.6e-1;
t390 = t2.*1.592040838891559e-17;
t195 = t111+t112+t113+t114+t115-t180+t194-t390-5.969197056312016e-50;
t196 = t9.*t43.*2.152934142846781e-1;
t197 = t13.*t43.*9.274373618014111e-4;
t198 = t5.*t37.*1.097689519141626e-1;
t199 = t9.*t46.*9.274373618014111e-4;
t200 = t7.*t40.*1.097689519141626e-1;
t204 = t3.*1.3582e-1;
t366 = t2.*8.316576413009676e-18;
t205 = t125+t126+t127-t187+t204-t366-3.118216708416531e-50;
t206 = t5.*t37.*1.4967e-2;
t207 = t7.*t37.*1.6044e-4;
t208 = t7.*t40.*1.4967e-2;
t211 = t19.*2.295845021658468e-49;
t212 = t2.*(t19-t24).*6.123233995736766e-17;
t213 = t5.*t26;
t214 = t28+t33-t192+t211+t212+t213;
t215 = t13.*t43;
t216 = t9.*t46;
t217 = t215+t216;
t218 = t146.*t217;
t219 = t20.*2.295845021658468e-49;
t220 = t5.*t37;
t221 = t7.*t40;
t222 = t9.*t43;
t374 = t13.*t46;
t223 = t222-t374;
t224 = t65.*t223;
t225 = t35+t36-t48+t219-t220-t221;
t226 = t2.*2.540928714850161e-34;
t227 = t5.*t6.*6.776895191416263e-2;
t228 = t7.*t8.*6.776895191416263e-2;
t423 = t3.*4.149651502162508e-18;
t229 = t111+t112+t113-t180+t226+t227+t228-t423+9.526956742857376e-67;
t230 = t9.*t52;
t231 = t13.*t55;
t232 = t230+t231;
t233 = t65.*t232;
t234 = t153.*t214;
t235 = t9.*t55;
t236 = t235-t13.*t52;
t237 = t233+t234-t146.*t236;
t238 = t20.*1.925e-1;
t239 = t19.*8.100000000000001e-2;
t240 = t3.*t19.*1.688910400704115e-17;
t241 = t2.*(t19-t24).*2.7582e-1;
t242 = t188+t238+t239+t240+t241-t5.*t23.*1.6044e-4-t5.*t26.*1.4967e-2-t7.*t26.*1.6044e-4;
t244 = t20.*8.100000000000001e-2;
t245 = t3.*t20.*1.688910400704115e-17;
t246 = t2.*t30.*2.7582e-1;
t294 = t5.*t40.*1.6044e-4;
t459 = t19.*1.925e-1;
t247 = t206+t207+t208+t244+t245+t246-t294-t459;
t249 = t20.*1.42521e-1;
t250 = t19.*8.100000000000001e-2;
t251 = t3.*t19.*1.641700266596984e-18;
t252 = t2.*(t19-t24).*2.6811e-2;
t253 = t3.*(t19-t24).*3.0849e-3;
t348 = t2.*t19.*1.888956455344835e-19;
t254 = t249+t250+t251+t252+t253-t348;
t257 = t20.*1.925e-1;
t258 = t19.*8.100000000000001e-2;
t259 = t3.*t19.*2.449293598294706e-17;
t260 = t2.*(t19-t24).*4.0e-1;
t261 = t9.*t55.*9.274373618014111e-4;
t263 = t20.*8.100000000000001e-2;
t264 = t3.*t20.*1.641700266596984e-18;
t265 = t2.*t30.*2.6811e-2;
t266 = t3.*t30.*3.0849e-3;
t347 = t2.*t20.*1.888956455344835e-19;
t267 = t19.*(-1.42521e-1)+t263+t264+t265+t266-t347;
t268 = t20.*8.100000000000001e-2;
t269 = t3.*t20.*2.449293598294706e-17;
t270 = t2.*t30.*4.0e-1;
t272 = t13.*t46.*2.152934142846781e-1;
t457 = t19.*1.925e-1;
t271 = t196+t197+t198+t199+t200+t268+t269+t270-t272-t457;
t273 = -t19+t24;
t274 = t3.*t273;
t275 = t21+t274;
t276 = t2.*t273.*6.123233995736766e-17;
t277 = t20+t25-t28+t276;
t278 = t7.*t275.*6.123233995736766e-17;
t288 = t2.*t273;
t289 = t5.*t277.*6.123233995736766e-17;
t279 = t24+t48+t49+t278-t288-t289;
t280 = t5.*t275;
t281 = t7.*t277;
t282 = t280+t281;
t283 = t20.*8.725608443924893e-18;
t377 = t19.*1.425e-1;
t284 = t196+t197+t198+t199+t200+t269+t270-t272+t283-t377;
t285 = t20.*1.425e-1;
t286 = t19.*8.725608443924893e-18;
t287 = t7.*t275.*1.097689519141626e-1;
t290 = t9.*t279.*2.152934142846781e-1;
t291 = t13.*t279.*9.274373618014111e-4;
t292 = t13.*t282.*2.152934142846781e-1;
t379 = t2.*t273.*4.0e-1;
t380 = t9.*t282.*9.274373618014111e-4;
t381 = t5.*t277.*1.097689519141626e-1;
t293 = t259+t285+t286+t287+t290+t291+t292-t379-t380-t381;
t295 = t20.*8.725608443924892e-18;
t411 = t19.*1.425e-1;
t296 = t206+t207+t208+t245+t246-t294+t295-t411;
t297 = t20.*1.425e-1;
t298 = t19.*8.725608443924892e-18;
t299 = t7.*t275.*1.4967e-2;
t406 = t5.*t275.*1.6044e-4;
t407 = t5.*t277.*1.4967e-2;
t408 = t7.*t277.*1.6044e-4;
t413 = t2.*t273.*2.7582e-1;
t300 = t240+t297+t298+t299-t406-t407-t408-t413;
t301 = t20.*5.342894225732869e-34;
t302 = t19.*3.271579155863317e-50;
t303 = t3.*t19.*9.18338008663387e-50;
t304 = t30.*t116;
t305 = t20.*2.946606165491677e-33;
t306 = t19.*1.804275904458619e-49;
t307 = t3.*t19.*5.06463411777858e-49;
t308 = t30.*t116.*5.515;
t309 = t20.*9.323350423903855e-34;
t310 = t19.*5.708905626981487e-50;
t311 = t30.*t128.*(3.49e2./2.0e2);
t312 = t3.*t19.*1.105003754409848e-49;
t313 = t20.*5.342894225732868e-34;
t314 = t19.*3.271579155863317e-50;
t315 = t30.*t128;
t316 = t3.*t19.*6.332399738738385e-50;
t317 = t20.*1.562776333016795e-33;
t318 = t19.*9.569245170061283e-50;
t319 = t3.*t19.*2.773003234449617e-50;
t320 = t20.*3.468981871291444e-34;
t321 = t19.*2.124138772488631e-50;
t322 = t3.*t19.*6.155390087568518e-51;
t323 = t20.*2.124138772488631e-50;
t324 = t3.*t20.*6.155390087568518e-51;
t325 = t2.*t30.*1.005251488323677e-34;
t326 = t3.*t30.*1.156652238383391e-35;
t327 = t20.*9.569245170061283e-50;
t328 = t3.*t20.*2.773003234449617e-50;
t329 = t2.*t30.*4.528657954898164e-34;
t330 = t3.*t30.*5.210718333917177e-35;
t331 = t20.*3.271579155863317e-50;
t332 = t3.*t20.*9.18338008663387e-50;
t333 = t9.*t43.*8.072210105402954e-34;
t334 = t13.*t43.*3.477333140419428e-36;
t335 = t5.*t37.*4.115676486645111e-34;
t336 = t9.*t46.*3.477333140419428e-36;
t337 = t7.*t40.*4.115676486645111e-34;
t338 = t2.*t30.*1.499759782661858e-33;
t339 = t20.*1.804275904458619e-49;
t340 = t3.*t20.*5.06463411777858e-49;
t341 = t9.*t43.*4.451823873129729e-33;
t342 = t13.*t43.*1.917749226941314e-35;
t343 = t5.*t37.*2.269795582384779e-33;
t344 = t9.*t46.*1.917749226941314e-35;
t345 = t7.*t40.*2.269795582384779e-33;
t346 = t2.*t30.*8.271175201380145e-33;
t349 = t20.*5.665277325195614e-18;
t350 = t19.*(-9.252100000000001e-2)+t264+t265+t266-t347+t349;
t351 = t20.*9.252100000000001e-2;
t352 = t19.*5.665277325195614e-18;
t353 = t251-t348+t351+t352-t2.*t273.*2.6811e-2-t3.*t273.*3.0849e-3;
t354 = t20.*3.271579155863317e-50;
t355 = t3.*t20.*6.332399738738385e-50;
t356 = t5.*t37.*5.611726166775006e-35;
t357 = t7.*t37.*6.015536488256711e-37;
t358 = t7.*t40.*5.611726166775006e-35;
t359 = t2.*t30.*1.034159358134484e-33;
t360 = t20.*5.708905626981487e-50;
t361 = t3.*t20.*1.105003754409848e-49;
t362 = t5.*t37.*9.792462161022385e-35;
t363 = t7.*t37.*1.049711117200796e-36;
t364 = t7.*t40.*9.792462161022385e-35;
t365 = t2.*t30.*1.804608079944675e-33;
t367 = t193.*t205;
t368 = t20.*5.092434342028338e-34;
t369 = t3.*t20.*8.316576413009676e-18;
t370 = t2.*t30.*1.3582e-1;
t371 = t128.*t273.*(3.49e2./2.0e2);
t372 = t19.*(-9.323350423903855e-34)+t360+t361+t362+t363+t364+t365+t371-t5.*t40.*1.049711117200796e-36;
t373 = t153.*t225;
t375 = t218+t224+t373;
t376 = t69.*t74.*3.749399456654644e-33;
t378 = t30.*t284.*5.515;
t453 = t273.*t293.*5.515;
t382 = t378-t453;
t383 = t24+t48+t49-t288;
t384 = t20.*9.748438587302075e-34;
t385 = t3.*t20.*1.592040838891559e-17;
t386 = t2.*t30.*2.6e-1;
t387 = t20.*1.592040838891559e-17;
t388 = t19.*9.748438587302075e-34;
t389 = t3.*t19.*1.592040838891559e-17;
t454 = t2.*t273.*2.6e-1;
t391 = t287+t290+t291+t292-t380-t381+t387+t388+t389-t454;
t392 = t7.*t275.*2.269795582384779e-33;
t393 = t9.*t279.*4.451823873129729e-33;
t394 = t13.*t279.*1.917749226941314e-35;
t395 = t13.*t282.*4.451823873129729e-33;
t434 = t2.*t273.*8.271175201380145e-33;
t435 = t9.*t282.*1.917749226941314e-35;
t436 = t5.*t277.*2.269795582384779e-33;
t396 = t305+t306+t307+t308+t392+t393+t394+t395-t434-t435-t436;
t397 = t160.*t193;
t398 = t220+t221;
t399 = t74.*t398;
t400 = t46.*t85;
t401 = t397+t399+t400;
t402 = t5.*t277;
t403 = t20.*8.316576413009676e-18;
t404 = t19.*5.092434342028338e-34;
t405 = t3.*t19.*8.316576413009676e-18;
t409 = t7.*t275.*9.792462161022385e-35;
t410 = t309+t310+t311+t312+t409-t2.*t273.*1.804608079944675e-33-t5.*t275.*1.049711117200796e-36-t5.*t277.*9.792462161022385e-35-t7.*t277.*1.049711117200796e-36;
t412 = t30.*t296.*(3.49e2./2.0e2);
t414 = t412-t273.*t300.*(3.49e2./2.0e2);
t455 = t2.*t273.*1.3582e-1;
t415 = t299+t403+t404+t405-t406-t407-t408-t455;
t458 = t19.*8.316576413009676e-18;
t416 = t206+t207+t208-t294+t368+t369+t370-t458;
t417 = t141.*t146.*3.749399456654644e-33;
t418 = t148.*t153.*3.749399456654644e-33;
t419 = t193.*t195;
t456 = t19.*1.592040838891559e-17;
t420 = t196+t197+t198+t199+t200-t272+t384+t385+t386-t456;
t421 = t116.*t273.*5.515;
t428 = t19.*2.946606165491677e-33;
t429 = t13.*t46.*4.451823873129729e-33;
t422 = t339+t340+t341+t342+t343+t344+t345+t346+t421-t428-t429;
t424 = t225.*t229;
t425 = t19.*2.540928714850161e-34;
t426 = t5.*t37.*6.776895191416263e-2;
t427 = t7.*t40.*6.776895191416263e-2;
t442 = t7.*t275;
t430 = t28+t33+t211-t276+t402-t442;
t431 = t20.*2.540928714850161e-34;
t432 = t19.*1.555870108751424e-50;
t433 = t3.*t19.*2.540928714850161e-34;
t437 = t193.*t375;
t438 = t9.*t279;
t439 = t13.*t282;
t440 = t438+t439;
t441 = t65.*t440;
t443 = t153.*t430;
t444 = t9.*t282;
t610 = t13.*t279;
t445 = t444-t610;
t693 = t146.*t445;
t446 = t441+t443-t693;
t677 = t60.*t65;
t447 = t147+t154-t677;
t448 = t155.*t447;
t668 = t20.*1.555870108751424e-50;
t669 = t3.*t20.*2.540928714850161e-34;
t670 = t2.*t30.*4.149651502162508e-18;
t449 = t196+t197+t199-t272+t425+t426+t427-t668-t669-t670;
t450 = t7.*t275.*6.776895191416263e-2;
t451 = t2.*t273.*4.149651502162508e-18;
t674 = t5.*t277.*6.776895191416263e-2;
t452 = t290+t291+t292-t380-t431-t432-t433+t450+t451-t674;
t460 = t30.*t284;
t684 = t273.*t293;
t461 = t460-t684;
t462 = t30.*t296;
t463 = t462-t273.*t300;
t464 = t193.*t205.*(3.49e2./2.0e2);
t465 = t155.*t416.*(3.49e2./2.0e2);
t466 = t464+t465;
t467 = t128.*t273;
t468 = t19.*(-5.342894225732868e-34)+t354+t355+t356+t357+t358+t359+t467-t5.*t40.*6.015536488256711e-37;
t469 = t20.*2.881087492837848e-33;
t470 = t19.*1.764157288083672e-49;
t471 = t3.*t19.*2.881087492837848e-33;
t472 = t9.*t279.*8.979785040610579e-2;
t473 = t13.*t279.*1.139316919009596e-3;
t474 = t13.*t282.*8.979785040610579e-2;
t475 = t5.*t277.*7.684130555159526e-1;
t604 = t7.*t275.*7.684130555159526e-1;
t605 = t2.*t273.*4.705172944303244e-17;
t606 = t9.*t282.*1.139316919009596e-3;
t476 = t469+t470+t471+t472+t473+t474+t475-t604-t605-t606;
t477 = t148.*t476;
t478 = t20.*3.366880115214081e-34;
t479 = t19.*2.061619478104898e-50;
t480 = t3.*t19.*3.366880115214081e-34;
t481 = t9.*t279.*4.876002456295764e-2;
t482 = t13.*t279.*2.53401226709415e-4;
t483 = t13.*t282.*4.876002456295764e-2;
t484 = t5.*t277.*8.979785040610579e-2;
t607 = t7.*t275.*8.979785040610579e-2;
t608 = t2.*t273.*5.498532503507515e-18;
t609 = t9.*t282.*2.53401226709415e-4;
t485 = t478+t479+t480+t481+t482+t483+t484-t607-t608-t609;
t486 = t20.*4.271754237092021e-36;
t487 = t19.*2.615695076599444e-52;
t488 = t3.*t19.*4.271754237092021e-36;
t489 = t9.*t279.*2.53401226709415e-4;
t490 = t13.*t279.*8.169842925973351e-1;
t491 = t13.*t282.*2.53401226709415e-4;
t492 = t5.*t277.*1.139316919009596e-3;
t611 = t7.*t275.*1.139316919009596e-3;
t612 = t2.*t273.*6.976304090397628e-20;
t613 = t9.*t282.*8.169842925973351e-1;
t493 = t486+t487+t488+t489+t490+t491+t492-t611-t612-t613;
t494 = t141.*t493;
t626 = t60.*t485;
t495 = t477+t494-t626;
t496 = t30.*t495;
t497 = t193.*t195.*5.515;
t498 = t155.*t420.*5.515;
t499 = t497+t498;
t500 = t116.*t273;
t682 = t19.*5.342894225732869e-34;
t683 = t13.*t46.*8.072210105402954e-34;
t501 = t331+t332+t333+t334+t335+t336+t337+t338+t500-t682-t683;
t502 = t20.*1.281507240289991e-35;
t503 = t3.*t20.*2.092860147402869e-19;
t504 = t5.*t37.*3.3204e-3;
t505 = t5.*t40.*1.4955e-5;
t506 = t7.*t40.*3.3204e-3;
t507 = t2.*t30.*3.4179e-3;
t591 = t19.*2.092860147402869e-19;
t592 = t7.*t37.*1.4955e-5;
t508 = t502+t503+t504+t505+t506+t507-t591-t592;
t509 = t155.*t508;
t510 = t19.*9.157296440624334e-22;
t511 = t3.*t20.*9.157296440624334e-22;
t512 = t5.*t40.*2.5506e-2;
t513 = t2.*t30.*1.4955e-5;
t585 = t20.*5.60722688742702e-38;
t586 = t5.*t37.*4.4101e-6;
t587 = t7.*t37.*2.5506e-2;
t588 = t7.*t40.*4.4101e-6;
t514 = -t510+t511+t512+t513+t585-t586-t587-t588;
t515 = t12.*t514;
t516 = t20.*1.244950595587608e-35;
t517 = t3.*t20.*2.033158615944436e-19;
t518 = t5.*t37.*2.53e-2;
t519 = t7.*t37.*4.4101e-6;
t520 = t7.*t40.*2.53e-2;
t521 = t2.*t30.*3.3204e-3;
t589 = t19.*2.033158615944436e-19;
t590 = t5.*t40.*4.4101e-6;
t522 = t516+t517+t518+t519+t520+t521-t589-t590;
t523 = t69.*t522;
t524 = -t509+t515+t523;
t525 = t20.*9.157296440624334e-22;
t526 = t19.*5.60722688742702e-38;
t527 = t3.*t19.*9.157296440624334e-22;
t528 = t5.*t275.*2.5506e-2;
t529 = t5.*t277.*4.4101e-6;
t530 = t7.*t277.*2.5506e-2;
t595 = t7.*t275.*4.4101e-6;
t596 = t2.*t273.*1.4955e-5;
t531 = t525+t526+t527+t528+t529+t530-t595-t596;
t532 = t12.*t531;
t533 = t20.*2.033158615944436e-19;
t534 = t19.*1.244950595587608e-35;
t535 = t3.*t19.*2.033158615944436e-19;
t536 = t7.*t275.*2.53e-2;
t597 = t5.*t275.*4.4101e-6;
t598 = t2.*t273.*3.3204e-3;
t599 = t5.*t277.*2.53e-2;
t600 = t7.*t277.*4.4101e-6;
t537 = t533+t534+t535+t536-t597-t598-t599-t600;
t538 = t69.*t537;
t539 = t20.*2.092860147402869e-19;
t540 = t19.*1.281507240289991e-35;
t541 = t3.*t19.*2.092860147402869e-19;
t542 = t5.*t275.*1.4955e-5;
t543 = t7.*t275.*3.3204e-3;
t544 = t7.*t277.*1.4955e-5;
t593 = t2.*t273.*3.4179e-3;
t594 = t5.*t277.*3.3204e-3;
t545 = t539+t540+t541+t542+t543+t544-t593-t594;
t641 = t155.*t545;
t546 = t532+t538-t641;
t547 = t205.*t383.*(3.49e2./2.0e2);
t548 = t155.*t415.*(3.49e2./2.0e2);
t549 = t547+t548;
t550 = t7.*t275.*5.611726166775006e-35;
t551 = t313+t314+t315+t316+t550-t2.*t273.*1.034159358134484e-33-t5.*t275.*6.015536488256711e-37-t5.*t277.*5.611726166775006e-35-t7.*t277.*6.015536488256711e-37;
t552 = t195.*t383.*5.515;
t553 = t155.*t391.*5.515;
t554 = t552+t553;
t555 = t7.*t275.*4.115676486645111e-34;
t556 = t9.*t279.*8.072210105402954e-34;
t557 = t13.*t279.*3.477333140419428e-36;
t558 = t13.*t282.*8.072210105402954e-34;
t689 = t2.*t273.*1.499759782661858e-33;
t690 = t9.*t282.*3.477333140419428e-36;
t691 = t5.*t277.*4.115676486645111e-34;
t559 = t301+t302+t303+t304+t555+t556+t557+t558-t689-t690-t691;
t560 = t20.*2.061619478104898e-50;
t561 = t3.*t20.*3.366880115214081e-34;
t562 = t9.*t43.*4.876002456295764e-2;
t563 = t13.*t43.*2.53401226709415e-4;
t564 = t9.*t46.*2.53401226709415e-4;
t565 = t2.*t30.*5.498532503507515e-18;
t614 = t19.*3.366880115214081e-34;
t615 = t5.*t37.*8.979785040610579e-2;
t616 = t13.*t46.*4.876002456295764e-2;
t617 = t7.*t40.*8.979785040610579e-2;
t566 = t560+t561+t562+t563+t564+t565-t614-t615-t616-t617;
t567 = t20.*2.615695076599444e-52;
t568 = t3.*t20.*4.271754237092021e-36;
t569 = t9.*t43.*2.53401226709415e-4;
t570 = t13.*t43.*8.169842925973351e-1;
t571 = t9.*t46.*8.169842925973351e-1;
t572 = t2.*t30.*6.976304090397628e-20;
t618 = t19.*4.271754237092021e-36;
t619 = t5.*t37.*1.139316919009596e-3;
t620 = t13.*t46.*2.53401226709415e-4;
t621 = t7.*t40.*1.139316919009596e-3;
t573 = t567+t568+t569+t570+t571+t572-t618-t619-t620-t621;
t574 = t141.*t573;
t575 = t20.*1.764157288083672e-49;
t576 = t3.*t20.*2.881087492837848e-33;
t577 = t9.*t43.*8.979785040610579e-2;
t578 = t13.*t43.*1.139316919009596e-3;
t579 = t9.*t46.*1.139316919009596e-3;
t580 = t2.*t30.*4.705172944303244e-17;
t622 = t19.*2.881087492837848e-33;
t623 = t5.*t37.*7.684130555159526e-1;
t624 = t13.*t46.*8.979785040610579e-2;
t625 = t7.*t40.*7.684130555159526e-1;
t581 = t575+t576+t577+t578+t579+t580-t622-t623-t624-t625;
t582 = t148.*t581;
t642 = t60.*t566;
t583 = t574+t582-t642;
t584 = t273.*t583;
t601 = t402-t442;
t602 = t193.*t391;
t603 = t193.*t391.*5.515;
t627 = t155.*t416;
t628 = t367+t627;
t629 = t155.*t420;
t630 = t419+t629;
t631 = t193.*t415;
t632 = t631-t383.*t416;
t633 = t193.*t415.*(3.49e2./2.0e2);
t634 = t633-t383.*t416.*(3.49e2./2.0e2);
t635 = t195.*t383;
t636 = t155.*t391;
t637 = t635+t636;
t638 = t205.*t383;
t639 = t155.*t415;
t640 = t638+t639;
t643 = t225.*t581;
t644 = t223.*t566;
t645 = t217.*t573;
t646 = t643+t644+t645;
t647 = t273.*t646;
t648 = t146.*t217.*3.749399456654644e-33;
t649 = t225.*t476;
t650 = t223.*t485;
t651 = t217.*t493;
t652 = t649+t650+t651;
t653 = t30.*t652;
t654 = t153.*t225.*3.749399456654644e-33;
t655 = t65.*t223.*3.749399456654644e-33;
t656 = t647+t648+t653+t654+t655;
t657 = t65.*t440.*3.749399456654644e-33;
t658 = t153.*t430.*3.749399456654644e-33;
t659 = t430.*t476;
t660 = t440.*t485;
t694 = t445.*t493;
t661 = t659+t660-t694;
t662 = t30.*t661;
t663 = t440.*t566;
t664 = t430.*t581;
t692 = t445.*t573;
t665 = t663+t664-t692;
t666 = t273.*t665;
t667 = t657+t658+t662+t666-t146.*t445.*3.749399456654644e-33;
t671 = t148.*t449;
t672 = t424+t671;
t673 = t229.*t430;
t675 = t225.*t452;
t676 = t257+t258+t259+t287+t290+t291+t292-t379-t380-t381;
t678 = t193.*t583;
t679 = t225.*t229.*5.515;
t680 = t148.*t449.*5.515;
t681 = t679+t680;
t685 = t383.*t495;
t686 = t229.*t430.*5.515;
t687 = t148.*(t290+t291+t292-t380-t431-t432-t433+t450+t451-t674).*5.515;
t688 = t686+t687;
t695 = t225.*t452.*5.515;
t696 = t193.*t665;
t697 = t155.*t446;
t698 = t383.*t661;
t699 = t696+t697+t698;
t700 = t193.*t646;
t701 = t155.*t375;
t702 = t383.*t652;
t703 = t700+t701+t702;
t704 = t148.*(t290+t291+t292-t380-t431-t432-t433+t450+t451-t674);
t705 = t673+t704;
M = reshape([t3.*(-2.282446919238515e-35)+t57+t75+t139+t147+t154-t12.*t85-t60.*t65-t67.*t68-t155.*t160+t100.*t242+t80.*t267+t123.*t247+t109.*t271+t134.*t254+t94.*(t181+t182+t183+t184+t257+t258+t259+t260-t5.*t26.*1.097689519141626e-1-t9.*t55.*9.274373618014111e-4)+(t19.*2.4366e-2+t20.*1.0969e-2).*(t19.*1.296587958e-1+t20.*5.83693397e-2)+(t19.*1.0969e-2-t20.*2.4366e-2).*(t19.*5.83693397e-2-t20.*1.296587958e-1)+2.3659e-2,t3.*(-2.282446919238515e-35)+t57+t75+t139+t147+t154+t242.*(t309+t310+t311+t312-t5.*t23.*1.049711117200796e-36+t7.*t23.*9.792462161022385e-35-t5.*t26.*9.792462161022385e-35-t7.*t26.*1.049711117200796e-36+t2.*(t19-t24).*1.804608079944675e-33)-t12.*t85-t60.*t65-t67.*t68-t155.*t160+(t181+t182+t183+t184+t257+t258+t259+t260-t261-t5.*t26.*1.097689519141626e-1).*(t305+t306+t307+t308+t7.*t23.*2.269795582384779e-33-t5.*t26.*2.269795582384779e-33+t9.*t52.*4.451823873129729e-33-t9.*t55.*1.917749226941314e-35+t13.*t52.*1.917749226941314e-35+t13.*t55.*4.451823873129729e-33+t2.*(t19-t24).*8.271175201380145e-33)+t267.*(t19.*(-1.562776333016795e-33)+t327+t328+t329+t330-t2.*t20.*3.19064476444505e-51+t136.*(t19-t24).*(9.01e2./2.0e2))+t271.*(t19.*(-2.946606165491677e-33)+t339+t340+t341+t342+t343+t344+t345+t346-t13.*t46.*4.451823873129729e-33-t22.*t116.*5.515)+t247.*(t19.*(-9.323350423903855e-34)+t360+t361+t362+t363+t364+t365-t5.*t40.*1.049711117200796e-36-t22.*t128.*(3.49e2./2.0e2))+t254.*(t317+t318+t319-t2.*t19.*3.19064476444505e-51+t2.*t22.*4.528657954898164e-34+t3.*t22.*5.210718333917177e-35-t30.*t136.*(9.01e2./2.0e2))+2.431330457587972e-67,t376+t417+t418+t496+t584-t12.*t85.*3.749399456654644e-33-t60.*t65.*3.749399456654644e-33-t155.*t160.*3.749399456654644e-33-t30.*t546+t247.*t466+t271.*t499-t273.*t524+t554.*t676+t549.*(t238+t239+t240+t299-t406-t407-t408-t413),t448+t678+t685+t271.*t681+t676.*t688,t3.*(-2.282446919238515e-35)+t57+t75+t139+t147+t154+t134.*(t320+t321+t322-t2.*t19.*7.082452307314206e-52+t2.*t22.*1.005251488323677e-34+t3.*t22.*1.156652238383391e-35-t30.*t136)-t12.*t85-t60.*t65-t67.*t68-t155.*t160+t100.*(t313+t314+t315+t316-t5.*t23.*6.015536488256711e-37+t7.*t23.*5.611726166775006e-35-t5.*t26.*5.611726166775006e-35-t7.*t26.*6.015536488256711e-37+t2.*(t19-t24).*1.034159358134484e-33)+t94.*(t301+t302+t303+t304+t7.*t23.*4.115676486645111e-34-t5.*t26.*4.115676486645111e-34+t9.*t52.*8.072210105402954e-34-t9.*t55.*3.477333140419428e-36+t13.*t52.*3.477333140419428e-36+t13.*t55.*8.072210105402954e-34+t2.*(t19-t24).*1.499759782661858e-33)+t109.*(t19.*(-5.342894225732869e-34)+t331+t332+t333+t334+t335+t336+t337+t338-t13.*t46.*8.072210105402954e-34-t22.*t116)+t80.*(t19.*(-3.468981871291444e-34)+t323+t324+t325+t326-t2.*t20.*7.082452307314206e-52+t136.*(t19-t24))+t123.*(t19.*(-5.342894225732868e-34)+t354+t355+t356+t357+t358+t359-t5.*t40.*6.015536488256711e-37-t22.*t128)+2.431330457587972e-67,t3.*(-2.282446919238515e-35)+t57+t75+t139+t147+t154+(-t317-t318-t319+t2.*t19.*3.19064476444505e-51+t30.*t136.*(9.01e2./2.0e2)+t2.*t273.*4.528657954898164e-34+t3.*t273.*5.210718333917177e-35).*(-t320-t321-t322+t2.*t19.*7.082452307314206e-52+t30.*t136+t2.*t273.*1.005251488323677e-34+t3.*t273.*1.156652238383391e-35)+(t30.*t350-t273.*t353).*(t30.*t350.*(9.01e2./2.0e2)-t273.*t353.*(9.01e2./2.0e2))-t12.*t85-t60.*t65-t67.*t68-t155.*t160+t372.*t468+t382.*t461+t414.*t463+t422.*t501+t396.*t559+t410.*t551+(t19.*(-1.562776333016795e-33)+t327+t328+t329+t330-t2.*t20.*3.19064476444505e-51-t136.*t273.*(9.01e2./2.0e2)).*(t19.*(-3.468981871291444e-34)+t323+t324+t325+t326-t2.*t20.*7.082452307314206e-52-t136.*t273)+2.431330457587972e-67,t376+t417+t418+t496+t584-t12.*t85.*3.749399456654644e-33-t60.*t65.*3.749399456654644e-33-t155.*t160.*3.749399456654644e-33-t30.*t546-t273.*t524+t466.*t468+t499.*t501-t463.*t634+t549.*t551+t554.*t559-t461.*(t603-t383.*t420.*5.515),t448+t678+t685+t501.*t681+t559.*t688-t461.*(t695-t430.*t449.*5.515),t376+t417+t418-t22.*(t218+t224+t153.*(t35+t36-t48+t219-t5.*t37-t7.*t40))-t12.*t85.*3.749399456654644e-33-t60.*t65.*3.749399456654644e-33+t30.*t237-t155.*t160.*3.749399456654644e-33+t401.*(t19-t24)+t94.*(t155.*(t181+t182+t183+t184+t387+t388+t389-t5.*t26.*1.097689519141626e-1-t9.*t55.*9.274373618014111e-4+t2.*(t19-t24).*2.6e-1)+t179.*t195)-t30.*(-t55.*t85+t160.*t179+t74.*(t192-t5.*t26))+t100.*(t155.*(t188+t403+t404+t405-t5.*t23.*1.6044e-4-t5.*t26.*1.4967e-2-t7.*t26.*1.6044e-4+t2.*(t19-t24).*1.3582e-1)+t179.*t205)+t123.*(t367+t155.*(t19.*(-8.316576413009676e-18)+t206+t207+t208+t368+t369+t370-t5.*t40.*1.6044e-4))+t109.*(t419+t155.*(t19.*(-1.592040838891559e-17)+t196+t197+t198+t199+t200+t384+t385+t386-t13.*t46.*2.152934142846781e-1)),t376+t417+t418-t12.*t85.*3.749399456654644e-33-t60.*t65.*3.749399456654644e-33-t155.*t160.*3.749399456654644e-33+t30.*t446+t273.*t375-t273.*t401+t372.*t628+t396.*t637-t414.*t632+t410.*t640+t422.*t630+t30.*(t85.*t282-t160.*t383+t74.*(t402-t7.*t275))-t382.*(t602-t383.*t420),t12.*t85.*(-1.405799628556214e-65)-t60.*t65.*1.405799628556214e-65+t69.*t74.*1.405799628556214e-65+t141.*t146.*1.405799628556214e-65+t148.*t153.*1.405799628556214e-65-t155.*t160.*1.405799628556214e-65+t30.*t495.*3.749399456654644e-33-t30.*t546.*3.749399456654644e-33+t30.*t667-t273.*t524.*3.749399456654644e-33+t273.*t583.*3.749399456654644e-33+t273.*t656+t466.*t628+t499.*t630+t549.*t640+t554.*t637+t632.*t634+(t602-t383.*t420).*(t603-t383.*t420.*5.515)-t273.*(-t30.*(-t46.*t531+t193.*t545+t398.*t537)-t273.*(-t46.*t514+t193.*t508+t398.*t522)+t46.*t85.*3.749399456654644e-33+t160.*t193.*3.749399456654644e-33+t74.*t398.*3.749399456654644e-33)+t30.*(t30.*(t282.*t531+t383.*t545-t537.*t601)+t273.*(t282.*t514+t383.*t508-t522.*t601)+t85.*t282.*3.749399456654644e-33-t160.*t383.*3.749399456654644e-33+t74.*t601.*3.749399456654644e-33),t155.*t447.*3.749399456654644e-33+t30.*t699+t193.*t583.*3.749399456654644e-33+t383.*t495.*3.749399456654644e-33+t273.*t703+t630.*t681+t637.*t688+(t602-t383.*t420).*(t695-t430.*t449.*5.515),t437+t448+t94.*(t214.*t229-t148.*(-t182-t183-t184+t261+t431+t432+t433+t2.*t22.*4.149651502162508e-18-t7.*t23.*6.776895191416263e-2+t5.*t26.*6.776895191416263e-2))+t179.*t237+t109.*(t424+t148.*(t20.*(-1.555870108751424e-50)+t196+t197+t199+t425+t426+t427-t3.*t20.*2.540928714850161e-34-t2.*t30.*4.149651502162508e-18-t13.*t46.*2.152934142846781e-1)),t437+t448+t383.*t446+t422.*t672+t396.*(t673+t148.*t452)-t382.*(t675-t430.*t449),t193.*t656+t383.*t667+t499.*t672+t554.*t705+(t675-t430.*t449).*(t603-t383.*t420.*5.515)+t155.*(t417+t418+t496+t584-t60.*t65.*3.749399456654644e-33),t193.*t703+t383.*t699+t672.*t681+t688.*t705+t155.*(t448+t678+t685)+(t675-t430.*t449).*(t695-t430.*t449.*5.515)],[4,4]);
